package com.easy.secret.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;

import lombok.Getter;
import lombok.Setter;

/**
 * @ProjectName: esay-secret-server
 * @Package: com.easy.secret.config
 * @ClassName: SecureProperties
 * @Description: 保密信息配置
 * @Author: wangjc
 * @CreateDate: 2023/11/17
 * @UpdateUser: wangjc
 * @UpdateDate: 2023/11/17
 * @UpdateRemark: 更新内容
 * @Version: 1.0
 */

@Getter
@Setter
@ConditionalOnProperty(
        name = {"sm.flag"},
        havingValue = "true"
)
@ConfigurationProperties("sm")
public class SecureProperties {
    private Integer cid;
    /**
     * 认证令牌
     */
    private String accessToken;
    /**
     * 偏移量
     */
    private String ivString;
    /**
     * 秘钥地址
     */
    private String sm4KeyUrl;
    /**
     * 证书文件名
     */
    private String pfxFileName;
    /**
     * 证书密码
     */
    private String pfxPasswd;
    /**
     * 仓id
     */
    private String compartId;
    /**
     * 加密后字符串类型： base64/hex
     */
    private String toStringType;
    /**
     * 当前使用的对称加密算法：sm4/aes
     * 默认为sm4
     */
    private String algorithm = "sm4";
}
